<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
	<link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
	<link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
	<script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
	<![endif]-->
	<title>添加员工管理账户</title>
</head>
<body>
<div class="contant">
<div class="row">
	<div class="panel panel-default">
		<div class="panel-body">
			<form role="form" id="myform" method="post"  class="form-horizontal">
			<!-- <form role="form" id="myform" method="post"  class="form-horizontal" onsubmit="return toVaild()"> -->
			    <div class="form-group">
			        <label class="col-sm-3 control-label">员工账号：<span class="c-red">*</span></label>
			        <div class="col-sm-4">
			        	<input class="form-control required" name="name" value="{$info.name}" maxlength='20'>
			        </div>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">员工密码：<elt name='info.id' value='0'><span class="c-red">*</span></elt></label>
			        <div class="col-sm-4">
			        	<input type="password" id="pwd" class="form-control <elt name='info.id' value='0'> required </elt> " name="pwd" maxlength='16' minlength='6'>
			        </div>
			        <gt name='info.id' value='0'><small>若不修改密码，此处请留空</small></gt>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">确认密码：</label>
			        <div class="col-sm-4">
			        	<input type="password" class="form-control" equalTo="#pwd" name="pwd2" maxlength='16' minlength='6'>
			        </div>
			        <gt name='info.id' value='0'><small>若不修改密码，此处请留空</small></gt>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">手机号码：<span class="c-red">*</span></label>
			        <div class="col-sm-4">
			        	<input class="form-control required mobile" name="tel" value="{$info.tel}" maxlength='11'>
			        </div>
			    </div>
			     <div class="form-group">
                    <label class="col-sm-3 control-label">图片：</label>
                    <div class="col-sm-4">
                        <img id="ajax_content" src="{$info.headimg}" width="100" height="100" />
                        <input type="hidden" id="img_box" name="headimg" value="{$info.headimg}"/>
                        <input id="fileId" type="file" multiple="multiple" name="file" class="uploadA" value="{$pic}"/>
                    </div>

                </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">选择所属组：<span class="c-red">*</span></label>
			        <div class="col-sm-4">
			           <select class="form-control" id="gid" name="gid">
			        		<option value="0" >无上级节点</option>
			        		<volist name='nodeList' id='node'>
			        			<option value="{$node.id}"<eq name='node.id' value='$info.gid'> selected </eq> ><eq name="node.pid" value="0">&nbsp;|-&nbsp;&nbsp;<else/>&nbsp;|&nbsp;&nbsp;|-&nbsp;&nbsp;</eq>{$node.name}</option>
			        		</volist>
						</select>
			        </div>
			     </div>

			     <div class="form-group" style="display: none;" id='money'>
		           <label class="col-sm-3 control-label" style="color: red">审核金额下限</label>
		           <div class="col-sm-2">
		           		<input class="form-control required money" name="min_money" value="{$info.min_money}" size="10" maxlength="20"/>
		           </div>
		           <label class="col-sm-1 control-label" style="color: red">金额上限</label>
		           <div class="col-sm-2">
		           		<input class="form-control required money" name="max_money" value="{$info.max_money}" size="10" maxlength="20" onblur="maxmoney()" />
		           </div>
		        </div>

			   <div class="form-group" id='bank'>
			        <label class="col-sm-3 control-label">银行：<span class="c-red">*</span></label>
			        <div class="col-sm-4">
				        <volist name='bankList' id='bank'>
				        	<label class="radio-inline">
				                <input type="checkbox" value="{$bank.id}" name="bid[]" <?php if(in_array($bank['id'], $info['bids'])){echo checked;} ?> >{$bank.bank_name}
				            </label>
			            </volist>
			        </div>
			    </div>
			    <div class="form-group">
					<label  class="col-sm-3 control-label">状态：</label>
					<div class="col-sm-4">
		            <label class="radio-inline">
		                <input type="radio" value="1" id="status1" name="status" <neq name="info.status" value="0">checked</neq>>启用
		            </label>
		            <label class="radio-inline">
		                <input type="radio" value="0"  id="status2" name="status" <eq name="info.status" value="0">checked</eq>>禁用
		            </label>
		            </div>
		        </div>
		       	<div class="form-group">
		           <label class="col-sm-3 control-label">备注：</label>
		           <div class="col-sm-4">
		           		<textarea rows="3" class="form-control" name="remark" maxlength='20'>{$info.remark}</textarea>
		           </div>
		        </div>
		        <gt name='info.id' value='0'> <input type='hidden' name='id' id="id" value='{$info.id}'></gt>
		        <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-5">
				        <button class="btn btn-primary" type="submit">提交</button>
				       	<a href="#" onClick="javascript :history.go(-1);"><button class=" btn btn-default" type="button">返回</button></a>
		       		</div>
		       	</div>
			</form>
		</div>
	</div>
</div>
</div>
<script src="__JS__/ajaxfileupload.js"></script>
<script type="text/javascript">
          $('.uploadA').change(function(){
            $.ajaxFileUpload({
                url:'{:U("Upload/logo")}',//处理图片脚本
                secureuri: false,
                fileElementId :'fileId',//file控件id
                dataType : 'text',
                success: function (data){
                    $("#ajax_content").attr("src",data);
                    $("#img_box").attr("value",data);
                },
                error: function(data){
                    alert(data+"333");
                }
            })
        })
        $('#gid').change(function(){
		var gid = $(this).val(), html = '<option value="">请选择身份</option>';
		if(gid ==10){
			$('#money').css('display','block');
		}else{
			$('#money').css('display','none');
		}
	  });
        var pid={$info.gid|default=0};
		if(pid==10){
			$('#money').css('display','block');
		}

		function maxmoney(){
          var min=Number($("input[name='min_money']").val()),max=Number($("input[name='max_money']").val());
          if(max <= min){
            alert('金额上限不能小于审核金额下限');
            return false;
          }
		}
</script>
</body>
</html>
